rPGP
OpenPGP implemented in pure Rust, permissively licensed
rPGP is a pure Rust implementation of OpenPGP, following the main RFCs
See IMPL_STATUS.md
for more details on the implemented PGP features.
It offers a flexible low-level API and gives users the ability to build higher level PGP tooling in the most compatible way possible. Additionally it fully supports all functionality required by the Autocrypt 1.1 e-mail encryption specification.
Usage
> cargo
Load a public key and verify an inline-signed message
use fs;
use ;
let pub_key_file = "key.asc";
let msg_file = "msg.asc";
let key_string = read_to_string.unwrap;
let = from_string.unwrap;
let msg_string = read_to_string.unwrap;
let = from_string.unwrap;
// Verify this message
// NOTE: This assumes that the primary serves as the signing key, which is not always the case!
msg.verify.unwrap;
let msg_content = msg.get_content.unwrap; // actual message content
let msg_string = String from_utf8.expect;
println!;
Generate and verify a detached signature with an OpenPGP keypair
use fs;
use ;
use ;
use HashAlgorithm;
let priv_key_file = "key.sec.asc";
let pub_key_file = "key.asc";
let data = b"Hello world!";
// Create a new signature using the private key
let secret_key_string = read_to_string.expect;
let signed_secret_key = from_string.unwrap.0;
let new_signature = signed_secret_key.create_signature.unwrap;
// Verify the signature using the public key
let key_string = read_to_string.expect;
let public_key = from_string.unwrap.0;
public_key.verify_signature.unwrap;
Current Status
Last updated April 2024
- Implementation Status: IMPL_STATUS.md
- Security Status: STATUS_SECURITY.md
- Supported Platforms: PLATFORMS.md
Users & Libraries built using rPGP
- Delta Chat: Cross-platform messaging app that works over e-mail
rpm
: A pure rust library for parsing and creating RPM filesrpgpie
: An experimental high level OpenPGP APIrsop
: A SOP CLI tool based on rPGP and rpgpiedebian-packaging
: a library crate for dealing with Debian packages
Don't see your project here? Please send a PR :)
FAQs
Checkout FAQ.md.
Minimum Supported Rust Version (MSRV)
All crates in this repository support Rust 1.74 or higher. In future minimally supported version of Rust can be changed, but it will be done with a minor version bump.
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.